package dr.incomeapp;

import android.content.Context;
import android.util.Log;

import com.google.ads.AdRequest;

import dr.incomeapp.dao.DataBaseHelper;

public class Application {

	public static Application application = null;

	protected AdRequest adRequest = new AdRequest();

	protected Context context = null;
	protected DataBaseHelper dataBaseHelper = null;

	private Application(Context context) {
		this.context = context;
		this.dataBaseHelper = new DataBaseHelper(context);
	}

	public static Application CreateInstance(Context context) {
		if (application == null) {
			application = new Application(context);
		}
		return application;
	}

	public static Application GetInstance() {
		return application;
	}

	public static void log(String tag, String value) {
		Log.v(tag, value);
	}

	public static void log(String tag, Exception ex) {
	
		Log.e(tag, "EXCEPTION " + ex.toString());
	}

	public Context getContext() {

		return context;
	}

	public DataBaseHelper getDataBaseHelper() {
		return dataBaseHelper;
	}

	public AdRequest getAdRequest() {
		return adRequest;
	}

}
